{extend name="$_admin_public_base_"/}
{block name="style"}{/block}

{block name="main"}
<section class="content pt-5">
    <div class="box box-solid eacoo-box">
        <div class="box-body">
            <div class="eacoo-tabs builder-form-tabs">
                <ul class="nav nav-tabs">
                    <li class=""><a href="{:url('edit',array('group_id'=>$group_id))}">角色信息</a></li>
                    <li class=""><a href="{:url('access',array('group_id'=>$group_id))}">权限分配</a></li>
                    <li class="active"><a href="{:url('accessUser',['group_id'=>$group_id])}">成员授权</a></li>
                    
                </ul>
            </div>

        <div class="builder-container listbuilder-box">

            <div class="row">    

                <div class="builder-table">      
                    <!-- 数据列表 -->
                    <div class="col-sm-12">
                    <table class="table table-responsive table-hover dataTable">
                    <thead>
                        <tr>
                        <th class="">UID</th>
                        <th class="">昵称</th>
                        <th class="">最后登录时间</th>
                        <th class="">最后登录IP</th>
                        <th class="">状态</th>
                        <th class="">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {volist name="_list" id="vo"}
                        <tr>
                            <td>{$vo.uid} </td>
                            <td>{$vo.nickname}</td>
                            <td><span>{$vo.last_login_time}</span></td>
                            <td><span>{$vo.last_login_ip}</span></td>
                            <td>{switch name="vo.status"}
                                    {case value="-1"}删除{/case}
                                    {case value="0"}禁用{/case}
                                    {case value="1"}正常{/case}
                                    {case value="2"}待审核{/case}
                                    {case value="3"}草稿{/case}
                                    {default /}未知
                                {/switch}</td>
                            <td><a href="{:url('AuthGroup/removeFromGroup?uid='.$vo['uid'].'&group_id='.input('group_id'))}" class="ajax-get confirm">解除授权</a>

                                </td>
                        </tr>
                        {/volist}
                    </tbody>
                    </table>

                    </div>          
            </div>   
            <div class="main-title">
                <div class="page_nav col-md-8">
                    {$_list->render()}
                </div>
                <div id="add-to-group" class="tools col-md-4">
                    <form class="add-user" action="{:url('AuthGroup/addToGroup')}" method="post" enctype="application/x-www-form-urlencoded" >
                    <div class="form-group">
                        <div class="col-md-10">
                            <!--<input class="form-control" id="admin_uid_list" type="number" name="uid" placeholder="请输入管理员uid,多个用英文逗号分隔">-->
                            <select id="admin_uid_list" type="number" name="uid" class="select2-container form-control" >
                                <option value="">请选择</option>
                                {volist name="admin_user_list" id="vo"}
                                    <option value="{$vo.uid|default=''}">{$vo.nickname}</option>
                                {/volist}
                            </select>
                        </div>
                        <input type="hidden" name="group_id" value="{:input('group_id')}">
                        <button type="submit" class="btn btn-info btn-raised btn-sm ajax-post col-md-2" target-form="add-user">新 增</button>
                    </div>
                    </form>
                </div>
            </div> 
           </div>
         </div>
    </div>
</div>
</section>
{/block}

{block name="script"}
<link rel="stylesheet" type="text/css" href="__LIBS__/select2/css/select2.min.css">
<link rel="stylesheet" type="text/css" href="__LIBS__/select2/css/select2-bootstrap.min.css">
<script type="text/javascript" src="__LIBS__/select2/js/select2.min.js" charset="utf-8"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $("#admin_uid_list").select2();         
    });
</script>
{/block}